package com.shuai.staticProxy.proxy;

import com.shuai.staticProxy.service.UserService;
import com.shuai.staticProxy.impl.UserServiceImpl;
import lombok.Data;

import java.util.List;

/**
 * @author shuaihong-coding
 * @date 2025/10/3
 * @className UserServiceProxy
 */
@Data
public class UserServiceProxy implements UserService {

    private UserService userService;

    public UserServiceProxy(UserService target) {
        this.userService = target;
    }

    public UserServiceProxy() {
        this.userService = new UserServiceImpl();
    }

    @Override
    public String getUserInfo(String username) {
    System.out.println("我是静态代理 --- 我要开始查询用户" + username + "的信息了");
    return userService.getUserInfo(username);
    }

    @Override
    public String getUserAll(List<String> usernameList) {
        System.out.println("我要开始查询用户列表" + usernameList + "的信息了");
        return userService.getUserAll(usernameList);
    }
}
